//
//  Context.m
//  策略模式
//
//  Created by flannery on 2018/12/18.
//  Copyright © 2018年 flannery. All rights reserved.
//

#import "Context.h"

@interface Context ()
@property (nonatomic, strong) id<Strategy> strategy;
@end

@implementation Context

- (instancetype)initWithStrategy:(id<Strategy>)strategy{
    if(self = [super init]) {
       //self
        self.strategy = strategy;
    }
    return self;
}

- (int)executeStrategyNum1:(int)num1 num2:(int)num2{
    return [self.strategy doOperationNum1:num1 num2:num2];
}

@end
